(function($){
	$.extend({
		substitute: function(str, object, regexp){		//对字符串中给出的替换标记进行值替换(类似简单模板).
			return str.toString().replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){
				if (match.charAt(0) == '\\') return match.slice(1);
				return (object[name] != undefined) ? object[name] : '';
			});
		},
		closeWindow: function () {
			window.opener = null;
			window.open('','_self');
			window.close();
			return this;
		}
	});
})(jQuery);
